package com.coda.service.impl;

import com.coda.service.TokenService;
import com.sun.org.apache.bcel.internal.generic.NEW;
import net.bytebuddy.matcher.BooleanMatcher;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

@Service
public class TokenServiceImpl implements TokenService {

    private Set<String> tokenBlackList = new HashSet();

    /**
     * 将token添加进黑名单
     */
    public void addTokenBlackList(String token){
        tokenBlackList.add(token);
    }

    /**
     * 判断该token是否为黑名单
     */
    public Boolean isBlackList(String token){
        return tokenBlackList.contains(token);
    }

}
